
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[PerferencesCreateDefault]
    @UserId INT ,
    @NamePathLogFile VARBINARY(MAX) ,
    @NamePathReportFile VARBINARY(MAX) ,
    @NamePathTemplateFile VARBINARY(MAX) ,
    @NamePathGame VARBINARY(MAX) ,
    @NameParseImageTags VARBINARY(MAX) ,
    @NameGroupSameTags VARBINARY(MAX) ,
    @NameViewPhotoListAsThumbnails VARBINARY(MAX) ,
    @ValuePathLogFile VARBINARY(MAX) ,
    @ValuePathReportFile VARBINARY(MAX) ,
    @ValuePathTemplateFile VARBINARY(MAX) ,
    @ValuePathGame VARBINARY(MAX) ,
    @ValueParseImageTags VARBINARY(MAX) ,
    @ValueGroupSameTags VARBINARY(MAX) ,
    @ValueViewPhotoListAsThumbnails VARBINARY(MAX)
AS 
    BEGIN
        DELETE  FROM Perferences
        WHERE   UserId = @UserId
	
        INSERT  INTO Perferences
                ( UserId ,
                  Name ,
                  Value
	          )
        VALUES  ( @UserId ,
                  @NamePathLogFile ,
                  @ValuePathLogFile
	          )
	
        INSERT  INTO Perferences
                ( UserId ,
                  Name ,
                  Value
	          )
        VALUES  ( @UserId ,
                  @NamePathReportFile ,
                  @ValuePathReportFile
	          )
	
        INSERT  INTO Perferences
                ( UserId ,
                  Name ,
                  Value
	          )
        VALUES  ( @UserId ,
                  @NamePathTemplateFile ,
                  @ValuePathTemplateFile
	          )
	
        INSERT  INTO Perferences
                ( UserId ,
                  Name ,
                  Value
	          )
        VALUES  ( @UserId ,
                  @NameParseImageTags ,
                  @ValueParseImageTags
	          )
	
        INSERT  INTO Perferences
                ( UserId ,
                  Name ,
                  Value
	          )
        VALUES  ( @UserId ,
                  @NameGroupSameTags ,
                  @ValueGroupSameTags
	          )
	          
        INSERT  INTO Perferences
                ( UserId ,
                  Name ,
                  Value
	          )
        VALUES  ( @UserId ,
                  @NameViewPhotoListAsThumbnails ,
                  @ValueViewPhotoListAsThumbnails
	          )
	
	
        INSERT  INTO Perferences
                ( UserId ,
                  Name ,
                  Value
	          )
        VALUES  ( @UserId ,
                  @NamePathGame ,
                  @ValuePathGame
	          )
    END
GO
